home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / GameboyDev / GBDK / lib / strcmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-29  |  224 b   |  18 lines

  1. #include <string.h>
  2.  
  3. /*
  4. /*
  5.  * Compare strings:
  6.  *  s1>s2: >0
  7.  *  s1==s2: 0
  8.  *  s1<s2: <0
  9.  */
  10.  
  11. BYTE strcmp(const char *s1, const char *s2)
  12. {
  13.   while(*s1 == *s2++)
  14.     if(*s1++=='\0')
  15.       return 0;
  16.   return (*s1 - *--s2);
  17. }
  18.